package com.xz.simplerpc.rpc;

import com.xz.simplerpc.api.ScoreService;
import com.xz.simplerpc.provider.ScoreServiceImpl;

/**
 * Created by fingal on 2018/1/7.
 */
public class ProviderMain8889 {
    public static void main(String[] args) throws InterruptedException {
        ScoreService scoreService = new ScoreServiceImpl();
        ServiceConfig serviceConfig = new ServiceConfig();
        serviceConfig.setRegistryConfig(new RegistryConfig("registry://127.0.0.1:2181"));
        serviceConfig.setProtocolConfig(new ProtocolConfig("rest"));
        serviceConfig.setPort(8889);
        serviceConfig.setRef(scoreService);
        serviceConfig.setInterfaceClass(ScoreService.class);
        serviceConfig.export();
        System.out.println("export success...");
        while (true) {
            Thread.sleep(100);
        }
    }
}
